package lesson11;

import java.util.TreeSet;

public class Test04 {
    public static void main(String[] args) {
        TreeSet treeSet = new TreeSet();
//        treeSet.add(1);
//        treeSet.add(2);
//        treeSet.add(3);
        treeSet.add(new Student("张飞",20,"男"));
        treeSet.add(new Student("小乔",18,"女"));
        treeSet.add(new Student("大乔",25,"女"));
        treeSet.add(new Student("关羽",22,"男"));
        treeSet.add(new Student("曹操",28,"男"));

        for(Object obj : treeSet){
            System.out.println(obj);
        }
    }
}
